package com.geotmt.billingcenter.modules.consume.service;

import com.geotmt.billingcenter.common.vo.consume.ConsumeHisVo;
import com.geotmt.billingcenter.common.vo.consume.ConsumeVo;
import com.geotmt.billingcenter.common.vo.params.ParamsConsume;
import com.geotmt.billingcenter.common.vo.params.ParamsForDel;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description 消耗配置 接口类
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/13 14:06
 * @Version     v1
 **/
public interface ConsumeService {

    /**
     * 添加
     * @param consumeVoList
     * @throws Exception
     */
    void addList(List<ConsumeVo> consumeVoList) throws Exception;

    /**
     *  批量添加/修改
     * @param consumeVoList
     * @param request
     * @throws Exception
     */
    void addUpdateList(List<ConsumeVo> consumeVoList, HttpServletRequest request) throws Exception;

    /**
     * 根据用户传进来的 list,找出
     * 1.已生效有修改的 list
     * 2.未生效的 list
     * 3.没有记录数据的 list
     * @param consumeVoList
     * @return
     */
    Map<String,Object> analyzeList(List<ConsumeVo> consumeVoList);

    /**
     * 更新
     * @param consumeVo
     * @throws Exception
     */
    void update(ConsumeVo consumeVo) throws Exception;

    /**
     * 删除
     * @param obj
     * @throws Exception
     */
    void delete(ParamsForDel obj) throws Exception;

    /**
     * curr list
     * @param paramsConsume
     * @return
     */
    List<ConsumeVo> list(ParamsConsume paramsConsume);

    /**
     * 添加或修改的回显
     * @param paramsConsume
     * @return
     */
    List<ConsumeVo> listAll(ParamsConsume paramsConsume);

    /**
     * 添加 his
     * @param consumeHisVo
     */
    void addHis(ConsumeHisVo consumeHisVo);

    /**
     * 覆盖修改
     * @param consumeHisVo
     * @throws Exception
     */
    void updateHis(ConsumeHisVo consumeHisVo) throws Exception;

    /**
     * 删除 his
     * @param obj
     */
    void deleteHis(ParamsForDel obj);

    /**
     * list his
     * @param paramsConsume
     * @return
     */
    List<ConsumeHisVo> listHis(ParamsConsume paramsConsume);

    /**
     * 得到当前生效的规则
     * @param code          可以为null
     * @param companyId     可以为null
     * @param cuserId
     * @param interfaceId
     * @param date
     * @return
     */
    ConsumeHisVo getConsume(String code, Integer companyId, Integer cuserId, Integer interfaceId, Date date);


}
